import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isToken: true,
    userInfo: {
      name: '源生态友康',
      roles: ['admin']
    },
    authList: [],
    routerList: [
      {
        path: '/',
        name: '',
        redirect: '/login'
      },
      {
        path: '/login',
        name: 'login',
        component: Login
      },
      {
        path: '/layout',
        name: 'layout',
        redirect: '/layout/index',
        component: () => import('../views/layout/index'),
        children: [
          {
            path: '/',
            name: 'home',
            component: () => import('../views/home/index')
          },
          {
            path: '/cuisine',
            name: 'cuisine',
            redirect: '/cuisine/index',
            children: [
              {
                path: '/cuisine/index',
                name: 'index',
                component: () => import('../views/cuisine/index')
              },
              {
                path: '/cuisine/addcuisine',
                name: 'addcuisine',
                component: () => import('../views/cuisine/addcuisine')
              },
              {
                path: '/cuisine/addmenu',
                name: 'index',
                component: () => import('../views/cuisine/addmenu')
              }
            ]
          },
          {
            path: '/details',
            name: 'details',
            component: () => import('../views/details/index')
          },
          {
            path: '/accounts',
            name: 'accounts',
            component: () => import('../views/accounts/index')
          },
          {
            path: '/staff',
            name: 'staff',
            component: () => import('../views/staff/index')
          },
          {
            path: '/set',
            name: 'set',
            component: () => import('../views/set/index')
          }
        ]
      }
    ]
  },
  mutations: {},
  actions: {},
  modules: {}
})
